<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
// 引入jsencrypt库
<script src="https://cdnjs.cloudflare.com/ajax/libs/jsencrypt/2.3.1/jsencrypt.min.js"></script>
<script>

    // 生成秘钥对
    var encrypt = new JSEncrypt();
    var privateKey = encrypt.getPrivateKey();
    var publicKey = encrypt.getPublicKey();

    console.log("Private Key: " + privateKey);
    console.log("Public Key: " + publicKey);
</script>

</body>
</html>
